<template>
  <el-dialog
    :model-value="visible"
    @update:model-value="$emit('update:visible', $event)"
    title="导入项目"
    width="30%"
    center
  >
    <el-upload
      class="upload-demo"
      drag
      action="#"
      :auto-upload="false"
      @change="handleFileChange"
    >
      <i class="el-icon-upload"></i>
      <div class="el-upload__text">
        将文件拖到此处，或<em>点击选择</em>
      </div>
    </el-upload>
    
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="$emit('close')">取消</el-button>
        <el-button type="primary" @click="confirmImport">确认导入</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script setup>
import { ref } from 'vue'

const fileInput = ref(null)
const selectedFile = ref(null)

const handleFileChange = (e) => {
  selectedFile.value = e.target.files[0]
}

const confirmImport = async () => {
  // 实现文件导入逻辑
}
</script>